import subprocess

cmd = "ipconfig"
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                     bufsize=1, universal_newlines=True, shell=True)
p.poll()
print(p.stderr.readline())
for i in p.stdout:
    print(i)

print(p.stderr.readline())


